<template>
    <el-card shadow="never" class="aui-card--fill">
        <div class="mod-demo__cfcardbank}">
            <el-form :inline="true" :model="dataForm">
                <el-form-item>
                    <el-input v-model="dataForm.name" placeholder="银行名称" clearable></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button v-if="$hasPermission('card:log:page')" :type="'primary'" :icon="'el-icon-query'" @click="getDataList()">查询</el-button>
                </el-form-item>
            </el-form>
            <table-page ref="childTable" :pageData="pageData"></table-page>
        </div>
    </el-card>
</template>

<script>
    import tablePage from "@/views/table/table.vue"
    import momnet from 'moment'

    export default {
        name: "index",
        components: {
            tablePage,
        },
        methods: {
            getDataList() {
                this.$refs.childTable.initData(this.pageData.queryUrl, this.dataForm);
            },
        },
        data() {
            return {
                dataForm: {},
                pageData: {
                    queryUrl: "/card/log/page",//请求路径和参数
                    selection: false,
                    sequence: true,
                    cols: [
                        {title: "手机号码", field: "mobilePhone"},
                        {title: "信用卡", field: "cardName"},
                        {title: "银行", field: "bankName"},
                        {title: "创建时间", field: "createTime",render(data, full) {
                                return momnet(data).format("YYYY-MM-DD HH:mm:ss")}}
                    ]
                }
            }
        }
    }
</script>
